<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Listings</title>

        <style>
            a {color:#404042;text-decoration:none;}      /* unvisited link */
            a:visited {color:#404042;}  /* visited link */
            a:hover {color:#404042;}  /* mouse over link */
            a:active {color:#404042;}  /* selected link */
            @font-face
            {
            font-family: avant;
            src: url('${model.props.appPath}/fonts/avangmi-webfont.ttf');
            }
        </style>
        <script type="text/javascript" src="js/jquery/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="js/token/jquery.tokeninput.js"></script>    
        <script type="text/javascript">            
            $(document).ready(function() {
                $("#cities-table tr:odd").css("background-color", "#ececec");
                $("#districts-table tr:odd").css("background-color", "#ececec");
                $("#buildings-table tr:odd").css("background-color", "#ececec");
                $("#villages-table tr:odd").css("background-color", "#ececec");
            });
        </script>      
    </head>


    <body style="text-align: center; background-color: #FAFAFA; color: #404042; font-family: avant, Century Gothic, Calibri, Verdana; padding: 0px; margin: 0px;">                

        <div style="margin-top: 0px; background-color: white;">

            <%@include file="header.jsp" %>

            <div style="width: 100%; text-align: left; font-family: avant, Century Gothic, Calibri, Verdana; color: #404042; background-color: white; background: url('${model.props.appPath}/img/content-bg-short.jpg'); background-repeat: repeat-x; display: block; position: relative; top: -2px;">

                <div style="width: 1220px; margin-top: 10px; margin: 0 auto;">

                    <br>
                    
                    <h1>Place Management</h1>
                    
                    
                    <br>
                    <h2>Cities</h2>
                    <br>
                    <br>
                    <table id="cities-table" border="1" cellpadding="5" cellspacing="5" style="width: 100%; font-size: 12px; border-collapse: collapse;">
                        <tr>
                            <th></th>
                            <th style="height: 20px"></th>
                            <th>Edit Info</th>
                            <th>Edit Photos</th>
                            <th>4sq</th>
                            <th>Impress</th>
                            <th>Views</th>
                        </tr>                        
                        <tr>
                            <td colspan="17"></td>
                        </tr>
                        <c:set var="i" value="0"/>
                        <c:forEach items="${model.cities}" var="place">
                            <c:set var="i" value="${i+1}"/>
                            <tr>
                                <td>${i}</td>
                                <td style="height: 20px"><a href="place.htm?a=2&id=${place.id}" style="color: #369;">${place.title}</a></td>
                                <td><a href="place.htm?a=4&id=${place.id}" style="color: #369;">Edit Info</a></td>
                                <td><a href="place.htm?a=1003&id=${place.id}" style="color: #369;">Edit Photo</a></td>                                
                                <td>${place.foursqVenueID}</td>                              
                                <td>${place.impressions}</td>
                                <td>${place.views}</td>
                            </tr>
                            <tr>
                                <td colspan="17"></td>
                            </tr>
                        </c:forEach>
                    </table>
                        
                    
                    <br>                    
                    <h2>Districts</h2>
                    <br>
                    <br>
                    <table id="districts-table" border="1" cellpadding="5" cellspacing="5" style="width: 100%; font-size: 12px; border-collapse: collapse;">
                        <tr>
                            <th></th>
                            <th style="height: 20px"></th>
                            <th>Edit Info</th>
                            <th>Edit Photos</th>
                            <th>Impress</th>
                            <th>Views</th>
                        </tr>                        
                        <tr>
                            <td colspan="17"></td>
                        </tr>
                        <c:set var="i" value="0"/>
                        <c:forEach items="${model.districts}" var="place">
                            <c:set var="i" value="${i+1}"/>
                            <tr>
                                <td>${i}</td>
                                <td style="height: 20px"><a href="place.htm?a=2&id=${place.id}" style="color: #369;">${place.title}</a></td>
                                <td><a href="place.htm?a=4&id=${place.id}" style="color: #369;">Edit Info</a></td>
                                <td><a href="place.htm?a=1003&id=${place.id}" style="color: #369;">Edit Photo</a></td>                                
                                <td>${place.impressions}</td>
                                <td>${place.views}</td>
                            </tr>
                            <tr>
                                <td colspan="17"></td>
                            </tr>
                        </c:forEach>
                    </table>
                        
                    <br>                    
                    <h2>Buildings</h2>
                    <br>
                    <br>
                    <table id="buildings-table" border="1" cellpadding="5" cellspacing="5" style="width: 100%; font-size: 12px; border-collapse: collapse;">
                        <tr>
                            <th></th>
                            <th style="height: 20px"></th>
                            <th>Edit Info</th>
                            <th>Edit Photos</th>
                            <th>Impress</th>
                            <th>Views</th>
                        </tr>                        
                        <tr>
                            <td colspan="17"></td>
                        </tr>
                        <c:set var="i" value="0"/>
                        <c:forEach items="${model.buildings}" var="place">
                            <c:set var="i" value="${i+1}"/>
                            <tr>
                                <td>${i}</td>
                                <td style="height: 20px"><a href="place.htm?a=2&id=${place.id}" style="color: #369;">${place.title}</a></td>
                                <td><a href="place.htm?a=4&id=${place.id}" style="color: #369;">Edit Info</a></td>
                                <td><a href="place.htm?a=1003&id=${place.id}" style="color: #369;">Edit Photo</a></td>                                
                                <td>${place.impressions}</td>
                                <td>${place.views}</td>
                            </tr>
                            <tr>
                                <td colspan="17"></td>
                            </tr>
                        </c:forEach>
                    </table>

                        
                    <br>                    
                    <h2>Villages</h2>
                    <br>
                    <br>
                    <table id="villages-table" border="1" cellpadding="5" cellspacing="5" style="width: 100%; font-size: 12px; border-collapse: collapse;">
                        <tr>
                            <th></th>
                            <th style="height: 20px"></th>
                            <th>Edit Info</th>
                            <th>Edit Photos</th>
                            <th>Impress</th>
                            <th>Views</th>
                        </tr>                        
                        <tr>
                            <td colspan="17"></td>
                        </tr>
                        <c:set var="i" value="0"/>
                        <c:forEach items="${model.villages}" var="place">
                            <c:set var="i" value="${i+1}"/>
                            <tr>
                                <td>${i}</td>
                                <td style="height: 20px"><a href="place.htm?a=2&id=${place.id}" style="color: #369;">${place.title}</a></td>
                                <td><a href="place.htm?a=4&id=${place.id}" style="color: #369;">Edit Info</a></td>
                                <td><a href="place.htm?a=1003&id=${place.id}" style="color: #369;">Edit Photo</a></td>                                
                                <td>${place.impressions}</td>
                                <td>${place.views}</td>
                            </tr>
                            <tr>
                                <td colspan="17"></td>
                            </tr>
                        </c:forEach>
                    </table>
                        
                </div>

                <br><br>                

            </div>

            <div>
                <img src="${model.props.appPath}/img/footer-foot.jpg" style="border: 0px solid black; display: block; width: 100%;" />
            </div>

        </div>

    </body>

</html>
